package com.lwq.lwqmicoservice.framework.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lwq.lwqmicoservice.common.model.SysMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2021/6/11
 */
@Mapper
public interface MenuMapper extends BaseMapper<SysMenu> {

    @Select("SELECT a.* FROM transit.sys_menu a INNER JOIN transit.rel_role_menu b ON a.id = b.menu_id WHERE a.status = #{status} and b.role_id IN (${ids})")
    List<SysMenu> getMenuByRoleIds(@Param(value = "ids") String ids, @Param(value = "status") String status);
}
